﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BanHangCshap.Class.gkhtdl63.DAL
{
    public abstract class ChitietDuanDAL : clsBaseDAL
    {
        //public DataTable ChitietDuan_LayTheoMa_Duan(string xlMa_Duan)
        //{
        //    string xlSPName = "sp_ChitietDuan_LayTheoMa_Duan";
        //    string[] xlSPPara = { "@Ma_Duan" };
        //    string[] xlSPValu = { xlMa_Duan };
        //    return base.Select(xlSPName, xlSPPara, xlSPValu);
        //}

        public bool ChitietDuan_Them(DAL.Entities.ChitietDuan CTDA)
        {
            string xlSPName = "sp_ChitietDuan_Them";
            string[] xlSPPara = {  "@STT"
                                    ,"@Id_Duan"
                                    ,"@Ma_QCBoSanpham"
                                    ,"@Soluong"
                                    ,"@Gia"
                                    ,"@Ghichu"

                                };

            object[] xlSPValu = {   
                                    CTDA.STT
                                    ,CTDA.Id_Duan
                                    ,CTDA.Ma_QCBoSanpham
                                    ,CTDA.Soluong
                                    ,CTDA.Gia
                                    ,CTDA.Ghichu
                                 };
            return base.Insert(xlSPName, xlSPPara, xlSPValu);
        }

        public bool ChitietDuan_Capnhat(DAL.Entities.ChitietDuan CTDA, long Idcu)
        {
            string xlSPName = "sp_ChitietDuan_Capnhat";
            string[] xlSPPara = {  
                                "@Idcu"                        
                                ,"@STT"
                                ,"@Id_Duan"
                                ,"@Ma_QCBoSanpham"
                                ,"@Soluong"
                                ,"@Gia"
                                ,"@Ghichu"
                                };

            object[] xlSPValu = {   Idcu
                                   ,CTDA.STT
                                    ,CTDA.Id_Duan
                                    ,CTDA.Ma_QCBoSanpham
                                    ,CTDA.Soluong
                                    ,CTDA.Gia
                                    ,CTDA.Ghichu
                                 };
            return base.Update(xlSPName, xlSPPara, xlSPValu);
        }

        public bool ChitietDuan_Xoa(long Id)
        {
            string xlSPName = "sp_ChitietDuan_Xoa";
            string[] xlSPPara = { "@Id" };
            object[] xlSPValu = { Id };
            return base.Update(xlSPName, xlSPPara, xlSPValu);
        }
    }
}
